package test.spring;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import utl.mofen.jsonStreamHandler.HandlerFactory;
import utl.mofen.jsonStreamHandler.IJSonStreamHandler;

import com.netty.handler.IJSonStreamNettyHandler;

public class ContextTester {
	@Test
	public void tester()
	{
		System.out.println(System.getProperty("java.library.path"));
		
//		ApplicationContext ctx = new FileSystemXmlApplicationContext("nettyHandler.xml");
//		IJSonStreamHandler handler = (IJSonStreamHandler)ctx.getBean("_default");
//		handler.setJSonStream(null);
//		
//		
//		IJSonStreamHandler handler2 = (IJSonStreamHandler)ctx.getBean("_default");
//		handler2.setJSonStream(null);
	}
	
	
	@Test
	public void testCreateBean() throws Exception
	{
		HandlerFactory.checkInitialize(null);
		IJSonStreamHandler handler = HandlerFactory.createHandler("fileRecv");
		handler.doAction();
//		ApplicationContext ctx = new FileSystemXmlApplicationContext("nettyHandler.xml");
//		IJSonStreamHandler handler = (IJSonStreamHandler)ctx.getBean("_default");
//		handler.setJSonStream(null);
//		
//		
//		IJSonStreamHandler handler2 = (IJSonStreamHandler)ctx.getBean("_default");
//		handler2.setJSonStream(null);
	}
}
